package com.siwei.mes.entity.mixproportion;

import com.alibaba.fastjson.JSONObject;
import com.siwei.mes.common.util.JsonUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Description: 细骨料-表观密度
 * @Version: 1.0
 * @author: YANGKE
 * @date: 2024/02/25 21:29
 */
@Data
@Accessors(chain = true)
public class NewRatio {

    @ApiModelProperty(value = "新配合比编号")
    private String xpebbh = "";
    @ApiModelProperty(value = "新抗渗等级")
    private String xksdj = "";

    /**
     * 字符串转成对象 然后再转成json
     *
     * @param object
     * @return
     */
    public JSONObject toJsonObject(Object object) {
        NewRatio entity = new NewRatio();
        if (object == null) {
            return JsonUtils.beanToObject(entity);
        }
        if (object instanceof String) {
            entity = JsonUtils.getObject((String) object, NewRatio.class);
        } else if (object instanceof JSONObject) {
            entity = JsonUtils.getObject((JSONObject) object, NewRatio.class);
        }
        return JsonUtils.beanToObject(entity);
    }

}
